import glob
import logging
import logging.handlers
from inv.settings import *

entity_formatter = logging.Formatter("%(asctime)s %(name)s > %(module)s > %(cls)s > "
    + "%(funcName)s --- %(message)s")

# Add the log message handler to the logger
entity_handler = logging.handlers.RotatingFileHandler(
    INV_ENTITY_LOG_FILENAME, maxBytes=10485760, backupCount=5)
entity_handler.setLevel(logging.DEBUG)
entity_handler.setFormatter(entity_formatter)

# Set up a specific logger with our desired output level
ENT = logging.getLogger('Entity')
ENT.addHandler(entity_handler)
ENT.setLevel(logging.DEBUG)

# Set up a specific logger with our desired output level
ADM = logging.getLogger('Admin')
ADM.addHandler(entity_handler)
ADM.setLevel(logging.DEBUG)
